package com.heima.stroke.handler.valuation;

/**
 * 起步价(3KM)
 * @author wyy
 */
public class StartPriceValuation implements Valuation {
    private Valuation valuation;

    private float startPrice  = 13.0f;  //3公里以内起步价13元

    public StartPriceValuation(Valuation valuation) {
        this.valuation = valuation;
    }

    @Override
    public float calculation(float km) {
        float beforeCost = (valuation == null ? 0.0f : valuation.calculation(km));

        return beforeCost + startPrice;
    }
}
